﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using MobileSales.Model.Clients;
using MobileSales.Model.Params;
using MobileSales.Model.Exceptions;

namespace MobileSales.Server.Services
{
    [ServiceContract]
    public interface IClientService
    {
        #region Client management

        [OperationContract]
        Client GetClient(int clientId);
        [OperationContract]
        [FaultContract(typeof(ValidationException))]
        void StoreClient(Client client);
        [OperationContract]
        [FaultContract(typeof(ValidationException))]
        void DeleteClient(int clientId);
        [OperationContract]
        IEnumerable<Client> GetClientList();
        [OperationContract]
        IEnumerable<Client> GetClientListByGroup(int groupId);
        [OperationContract]
        IDictionary<int, string> GetClientNameList();

        [OperationContract]
        Dictionary<Param, string> GetClientParams(int clientId);
        [OperationContract]
        [FaultContract(typeof(ValidationException))]
        void StoreClientParams(int clientId, Dictionary<Param, string> paramDict);

        #endregion

        #region Client group management
        [OperationContract]
        Model.Clients.ClientGroup GetClientGroup(int clientGroupId);
        [OperationContract]
        IEnumerable<Model.Clients.ClientGroup> GetClientGroupList();
        [OperationContract]
        [FaultContract(typeof(ValidationException))]
        void StoreClientGroup(ClientGroup group);
        [OperationContract]
        [FaultContract(typeof(ValidationException))]
        void DeleteClientGroup(int clientGroupId);
        #endregion
    }
}
